home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
ctldlt.zip
/
USEDTL.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-09
|
3KB
|
63 lines
#include <owl.h> // Program to display a dialog box
#include <dialog.h> // With a Blue Rectangle in it and
#include <static.h> // a Button that when pressed displays
#include <bwcc.h> // a second blue rectangle
#include "ctldtl.h" // Digital display custom control
#include "ctlcol.h" // Colored Rectangle custom control
#include "usedtl.h"
class TMyDialog : public TDialog // Dialog class to add
{ // processing for
private: // button selections
PTDigital pDigital;
public:
TMyDialog(PTWindowsObject AParent,LPSTR lpName)// constructor calls
:TDialog(AParent,lpName)
{
BWCCGetVersion(); // Forces DLLs to load
CTLDTLGetVersion();
CTLCOLGetVersion();
};
virtual void HandleButtonMessage(RTMessage Msg) // button handler
= [ID_FIRST + IDB_CREATE];
};
void TMyDialog:: HandleButtonMessage(RTMessage)
{
MessageBeep(0);
pDigital = new TDigital(this,201,100,100,120,32,
(LPSTR)"$50.96~0~0~255~",17);
GetApplication()->MakeWindow(pDigital);
InvalidateRect(HWindow,NULL,FALSE);
}
class TMyApp : public TApplication // Application Class to contain
{ // the application
public:
TMyApp(LPSTR lpName, HINSTANCE hInstance, // constructor calls the
HINSTANCE hPrevInstance, // base class constructor
LPSTR lpCmdLine, int nCmdShow)
:TApplication(lpName, hInstance,
hPrevInstance,
lpCmdLine, nCmdShow) {};
virtual void InitMainWindow(); // overrides base class InitMainWindow
};
void TMyApp::InitMainWindow() // to initialize a dialog box
{ // as the main window
MainWindow = new TMyDialog(NULL,"Main_Window_Dialog");
} // using message processing provided
// by derived class
int PASCAL WinMain(HINSTANCE hInstance, // main entry point from
HINSTANCE hPrevInstance, // windows to this program
LPSTR lpCmdLine,
int nCmdShow)
{
TMyApp Program("Dialog Tester",hInstance, // create instance of
hPrevInstance, // the dialog application
lpCmdLine,nCmdShow);
Program.Run(); // run it
return (Program.Status); // exit
}
/**********************************************************************/